package com.cnhis.cloudhealth.clidoctorweb.test;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;

import com.alibaba.dubbo.config.annotation.Reference;
import com.cnhis.cloudhealth.clidoctorweb.clisendadvice.CliSendAdviceRest;
import com.cnhis.cloudhealth.commons.Mappers.ModelVo;

import net.sf.json.JSONObject;

public class threadtest2 {
    @Reference
    private static CliSendAdviceRest cliSendAdviceRest;
    
    static int y=0;
    public static void main(String[] args) {
        for(int i=0;i<10;i++){
            y++;
            new MyThread().run();
            
        }
    }

    public static class MyThread implements Runnable{

        @Override
        public void run() {
            ModelVo mo = new ModelVo();
             String savePrintList= "[]";
             Map<String, Object> lXml = new HashMap<>();
             Map<String, Object> zjAddList = new HashMap<>();
             List<Map<String,Object>> vaf1List = new ArrayList<Map<String,Object>>();
             List<Map<String,Object>> vbd1List = new ArrayList<Map<String,Object>>();
             List<Map<String,Object>> zjList = new ArrayList<Map<String,Object>>();
             Map<String, Object> vaf01 = new HashMap<String, Object>();
             vaf01.put("vaf01", 953155452072366083L);
             vaf1List.add(vaf01);
             Map<String, Object> vbd01 = new HashMap<String, Object>();
             vbd01.put("vaf01", 953155452072366083L);
             vbd01.put("bby01", 6777);
             vbd01.put("vbd04", 1);
             vbd01.put("bby25", 2.5);
             vbd01.put("vbd05", 2.5);
             vbd01.put("vbd06", 0);
             vbd01.put("bck01", 72);
             vbd01.put("bdn01", "1");
             vbd01.put("vbd08", 1);
             vbd01.put("vbd09", 0);
             vbd01.put("dsk01", 7228);
             vbd01.put("bby01a", 0);
             vbd01.put("vbd12", 1);
             vbd01.put("bag05", 1);
             vbd01.put("bby05", "葡萄糖酸钙注射液");
             vbd1List.add(vbd01);
             Map<String, Object> vbd02 = new HashMap<String, Object>();
             vbd02.put("vaf01", 953155452072366082L);
             vbd02.put("bby01", 12290);
             vbd02.put("vbd04", 1);
             vbd02.put("bby25", 11.4);
             vbd02.put("vbd05", 11.4);
             vbd02.put("vbd06", 0);
             vbd02.put("bck01", 30);
             vbd02.put("bdn01", "Z");
             vbd02.put("vbd08", 1);
             vbd02.put("vbd09", 0);
             vbd02.put("dsk01", 0);
             vbd02.put("bby01a", 0);
             vbd02.put("vbd12", 1);
             vbd02.put("bag05", 0);
             vbd02.put("bby05", "口服药袋");
             vbd1List.add(vbd02);
             lXml.put("VAF1", vaf1List);
             lXml.put("VBD1", vbd1List);
             lXml.put("zjAddList", zjAddList);
             
             int lSign=2;
             int lBCE01 =1;
             String lBCE02="";
             String lBCE03="管理员";
             int lBCK01=30;
             int lACF01=1;
             long lVAA07 =953076363307393025L;
             long lVAA01=953076363307393024L;
             try {
                 ApplicationContext ctx = new FileSystemXmlApplicationContext("src//main//resources//META-INF//spring//applicationContext-datasource.xml");
                 cliSendAdviceRest = (CliSendAdviceRest)ctx.getBean("CliSendAdviceRest");
                 cliSendAdviceRest.clinicAdviceSend(JSONObject.fromObject(lXml).toString(), lSign, lBCE01, lBCE02, lBCE03, lBCK01, lACF01, lVAA07, lVAA01, "", savePrintList, "");
            } catch (Exception e) {
                e.printStackTrace();
            }
            
        }
    }
}
